From 73a6aaebfd599ce7e7ff14fbdc8b468fbe548ca1 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 19 Apr 2019 15:39:23 -0400 Subject: [PATCH] surface: Make gdk_surface_get_device_position void None of the callers were using the return value, and without child surfaces, it is not very useful. --- gdk/gdksurface.c | 14 ++++---------- gdk/gdksurface.h | 10 +++++----- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c index df4012c029..cea6412f81 100644 --- a/gdk/gdksurface.c +++ b/gdk/gdksurface.c @@ -1492,12 +1492,8 @@ gdk_surface_constrain_size (GdkGeometry *geometry, * Obtains the current device position in doubles and modifier state. * The position is given in coordinates relative to the upper left * corner of @surface. - * - * Returns: (nullable) (transfer none): The surface underneath @device - * (as with gdk_device_get_surface_at_position()), or %NULL if the - * surface is not known to GDK. **/ -GdkSurface * +void gdk_surface_get_device_position (GdkSurface *surface, GdkDevice *device, double *x, @@ -1507,9 +1503,9 @@ gdk_surface_get_device_position (GdkSurface *surface, gdouble tmp_x, tmp_y; GdkModifierType tmp_mask; - g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL); - g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); - g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL); + g_return_if_fail (GDK_IS_SURFACE (surface)); + g_return_if_fail (GDK_IS_DEVICE (device)); + g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD); tmp_x = tmp_y = 0; tmp_mask = 0; @@ -1524,8 +1520,6 @@ gdk_surface_get_device_position (GdkSurface *surface, *y = tmp_y; if (mask) *mask = tmp_mask; - - return NULL; } static void diff --git a/gdk/gdksurface.h b/gdk/gdksurface.h index c39fc885b6..d64c63dd18 100644 --- a/gdk/gdksurface.h +++ b/gdk/gdksurface.h @@ -598,11 +598,11 @@ GDK_AVAILABLE_IN_ALL gint gdk_surface_get_scale_factor (GdkSurface *surface); GDK_AVAILABLE_IN_ALL -GdkSurface * gdk_surface_get_device_position (GdkSurface *surface, - GdkDevice *device, - double *x, - double *y, - GdkModifierType *mask); +void gdk_surface_get_device_position (GdkSurface *surface, + GdkDevice *device, + double *x, + double *y, + GdkModifierType *mask); GDK_AVAILABLE_IN_ALL void gdk_surface_set_icon_list (GdkSurface *surface, GList *surfaces); -- 2.30.2